package com.example.prototype;

import java.util.Arrays;

/**
 * 原型模式，可以浅拷贝和深拷贝
 */
public class Test {
    public static void main(String[] args) {
        Prototype prototype = new Prototype(1, "11", Arrays.asList("1", "2", "3"));

        Prototype clone = prototype.clone();

        prototype.setId(33);

        prototype.setTags(Arrays.asList("1231313", "13213131"));

        System.out.println(prototype);

        System.out.println(clone);
    }
}
